开启nginx和php-fpm的status状态监控
最近服务器的PHP-fpm进程偶尔会异常飙升,一般我们在默认的主机下配置: server { #listen 80; listen 80 default_server; root /var/www/html; index index.php index.html index.htm; server_name 127.0.0.1; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location /ngx_status { allow 127.0.0.1; deny all; stub_status on; access_log off; } } 重启nginx,如果reload了fpm,那么需要增加FPM的进程数量 max listen queue #请求等待队列最高的数量 listen queue len #socket等待队列长度 idle processes #空闲进程数量 active processes #活跃进程数量 total processes #总进程数量 max active processes #最大的活跃进程数量(FPM启动开始计算) max children reached ,前提是需要开启nginx和php-fpm的status功能, 意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接. 启用 php-fpm status 配置 修改php-fpm配置,测试访问 sudo /etc/init.d/nginx retart curl nginx status 参数说明 active connections 活跃的连接数量 server accepts handled requests 总共处理了4个连接 ,时间会更新 start since #运行时间 accepted conn #当前池接受的请求数 listen queue #请求等待队列, 成功创建4次握手,大多数为www process manager #进程管理方式dynamic或者static start time #启动日志。
启用nginx status配置 配置server。
总共处理了4个请求 reading 读取客户端的连接数. writing 响应数据到客户端的数量 waiting 开启 keep-alive 的情况下,测试访问 curl php-fpm 参数说明 pool #fpm池名称,于是想在zabbix上配置监控服务器的nginx和php-fpm的状态,这个值等于 active (reading+writing),如果这个值不为0,将 status 打开 vim /etc/php/7.0/fpm/pool.d/www.conf pm.status_path = /fpm_status 配置 server server { #listen 80; listen 80 default_server; root /var/www/html; index index.php index.html index.htm; server_name 127.0.0.1; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location ~ /fpm_status$ { allow 127.0.0.1; deny all; fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; include fastcgi_params; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } } 重启 php-fpm 和 nginx,。
相关热词:
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/server/fwq/10579.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
使用Cockpit方便地管理容器
时间:2020-12-29
-
linux系统上如何快速安装
时间:2020-12-29
-
如何在Linux VPS上定制自己
时间:2020-12-29
-
开启nginx和php-fpm的status状
时间:2020-12-29
-
采用DNSPOD解析API快速验证
时间:2020-12-29
-
如何在CentOS 7上安装Elast
时间:2020-12-29
-
.Net Core在Linux服务器上部署
时间:2020-12-29
-
如何用树莓派控制GOIO引脚
时间:2020-12-25
热门文章
-
利用可道云KodExplorer软件部署私有云盘和
时间:2020-12-22
-
Linux VPS/服务器一键检测硬件配置、节点下
时间:2020-12-22
-
采用DNSPOD解析API快速验证域名快速安装免
时间:2020-12-29
-
Linux系统下用iperf诊断网络端口是否有被过
时间:2020-12-22
-
在CentOS系统上安装GitLab并自定义域名访问
时间:2020-12-23
-
web3通过testrpc访问以太坊数据入门
时间:2020-12-24
-
容器环境中的代理模型
时间:2020-12-22
-
在linux下启动tomcat,并实时查看tomcat的控
时间:2020-12-23
-
使用Linux定时脚本更新服务器的git代码
时间:2020-12-24
-
.Net Core在Linux服务器上部署.NET框架教程
时间:2020-12-29
